#ifndef __CONFIGURE_H__
#define __CONFIGURE_H__

#include <vector>

#include "global.h"

class Configure {
public:
	class Garbage {
	public:
		~Garbage() {
			if(Configure::instance_) {
				delete Configure::instance_;
				Configure::instance_ = NULL;
			}
		}
	};

	~Configure();

	static Configure* GetInstance() {
		if(instance_ == NULL) {
			if(instance_ == NULL) {
				instance_ = new Configure();
				static Garbage garbage;
			}
		}
		return instance_;
	}
	bool Load(const char *configure_name);
	const char *GetString(const char *item_name);
	int GetIntDefault(const char *item_name, int def);

	std::vector<LPConfItem> configure_item_list_;
private:
	Configure();
	static Configure *instance_;
};

#endif
